package Java_test;

import java.util.Scanner;

/**
 * 通过80%测试用例
 */

public class 回文数test {
    public static void main(String args[]) {
        int i = 0;
        int j = 0;
        int k = 0;
        int t = 0;
        int count = 0;
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
//        String str1 = "aba";
//        String str2 = "b";
        char[] a = str1.toCharArray();
        char[] b = str2.toCharArray();
        int tmp = a.length + b.length;
        char[] c = new char[tmp];

        for ( i = 0; i < a.length; i++) {
            int index = 0;
            for( j = 0;j < i;j++) {
                c[j] = a[j];
                index++;
            }
            for( k = 0;k < b.length;k++) {
                c[index++] = b[k];
            }
            for(t = i; t < a.length;t++) {
                c[index++] = a[t];
            }
            int left = 0;
            int right = c.length-1;
            boolean flag = true;
            while(left < right) {
                if(c[left] != c[right]){
                    flag = false;
                    break;
                }
                left++;
                right--;
            }
            if(flag == true)
                count++;

        }
        System.out.println(count);

    }
}
